﻿using ClassLibrary5;
using Main.DBHelp;
using NFine.Data.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tool;

namespace Main
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            ////这个速度快
            //DBSentence dv = new DBSentence();
            ////左链接
            //string aa = dv.filed("s.*,m.*") + dv.tableName("car as s") + dv.Join("car_detail m", "m.car_id=s.car_id", "left") + dv.where("s.car_id='122222222'");
            //List<car> carlist = DbHelper.GetList<car>(aa);
            Dictionary<object, object> dc = new Dictionary<object, object>();
            PHPCanshu cz = new PHPCanshu();
            List<Dictionary <object, object>> listdc =new List<Dictionary<object, object>>();

            //string[] text = { "Albert was here", "Burke slept late", "Connor is happy" };
            //var tokens = text.Select(s => s.Split(' '));
            //foreach (string[] line in tokens)
            //    foreach (string token in line)
            //        Console.Write("{0}.", token);




            //string[] text = { "Albert was here", "Burke slept late", "Connor is happy" };
            //var tokens = text.SelectMany(s => s.Split(' '));
            //foreach (string token in tokens)
            //    Console.Write("{0}.", token);


            //dc["car_id"] = "1232123123";
            //dc["car_no"] = "3";
            ////PHPCanshu.add("car", dc);//一条插入
            ////
            //listdc.Add(dc);
            //dc = new Dictionary<object, object>();
            //dc["car_id"] = "1211231232";
            //dc["car_no"] = "3";

            //listdc.Add(dc);
            //PHPCanshu.ListAdd("car", listdc);//多条数据插入

            //Dictionary<object, object> dc1 = new Dictionary<object, object>();
            ////dc1["car_no"] = "3";
            ////cz.update("car", dc1, dc);
            //cz.delete("car", dc);
            //string json= PHPCanshu.select<car>("*","car", dc);//第一步,确定返回类型,第二部选择对应查询方法

            //注入测试

            //连接,可扩展方法,
            //SelectWithJoin swj = new SelectWithJoin();
            //swj.filed("s.car_id,s.car_no");
            //swj.where(dc);
            //swj.table("car s");
            //swj.join("car_detail m", "m.car_id=s.car_id", "left");
            //swj.fetchsql(true);
            //string r = swj.select();

            //var count = PHPCanshu.Count(r);
        }
    }
}
